package com.okami.controller;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Description;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: TanJingyu
 * @create: 2021-01-18 17:42
 **/
@RestController
@RequestMapping("/beanFactory")
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class BeanFactoryController {
    @Autowired
    private BeanFactory beanFactory;

    @GetMapping
    public void test() {
        Object beanFactoryController = beanFactory.getBean("beanFactoryController");
        System.out.println(beanFactoryController);
    }
}
